﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QiHe
{
    public partial class Add_Task : Form
    {
        DataSet HSPEGNList, DeptList;
        public string EQFlag = "000000";
        public Add_Task(string Flag)
        {
            EQFlag = Flag;
            InitializeComponent();

            MedEQ.Service1 sop = new MedEQ.Service1();
            HSPEGNList = sop.Serv_HSP_Egn_List(DataTemp.HSPID);

            comboBox1.DataSource = HSPEGNList.Tables[0];
            comboBox1.DisplayMember = "ChineseName";
            comboBox1.ValueMember = "ID";

            DeptList = sop.HSP_Department_List(DataTemp.HSPID);
           
            comboBox2.DataSource = DeptList.Tables[0];
            comboBox2.DataSource = DeptList.Tables[0];
            comboBox2.DisplayMember = "Name";
            comboBox2.ValueMember = "DeptNumber";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string TSKflag = Guid.NewGuid().ToString();
            MedEQ.Service1 sop = new MedEQ.Service1();
            string result = sop.Add_Task_Win(TSKflag, EQFlag, textBox1.Text.ToString(), "无", comboBox1.SelectedValue.ToString(), DateTime.Now.ToShortDateString() + " " + DateTime.Now.ToLocalTime().ToString(), "无", "427", "等待回应", "0", "0", "0", comboBox2.SelectedValue.ToString(), DataTemp.HSPID, "维修", "0");

            if (result == "1")
                MessageBox.Show("添加成功");
        
        }
    }
}
